package ch.comtools.ssh;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Roger Dudler <roger.dudler@gmail.com>
 * @since 1.0
 * @version $Id$
 */
public class SSHClientConfiguration {

	private static SSHClientConfiguration instance;
	private Map<String, String> properties = new HashMap<String, String>();
	
	/**
	 * Private constructor.
	 */
	private SSHClientConfiguration() {
		this.init();
	}
	
	/**
	 * Initialize with default properties.
	 */
	public void init() {
		this.set("key.exchange.algorithm", "diffie-hellman-group1-sha1");
		this.set("server.hostkey.algorithm", "ssh-rsa");
		this.set("encryption.algorithm.c2s", "3des-cbc");
		this.set("encryption.algorithm.s2c", "3des-cbc");
		this.set("mac.algorithm.c2s", "hmac-md5");
		this.set("mac.algorithm.s2c", "hmac-md5");
		this.set("compression.algorithm.c2s", "none");
		this.set("compression.algorithm.s2c", "none");
		this.set("language.c2s", "");
		this.set("language.s2c", "");
	}
	
	/**
	 * Get singleton instance of {@link SSHClientConfiguration}.
	 * @return
	 */
	public static SSHClientConfiguration getInstance() {
		if (instance == null) {
			instance = new SSHClientConfiguration();
		}
		return instance;
	}
	
	/**
	 * @param property
	 * @return
	 */
	public String get(String property) {
		return this.properties.get(property);
	}
	
	/**
	 * @param property
	 * @param value
	 */
	public void set(String property, String value) {
		this.properties.put(property, value);
	}

}
